/**
*      author: Y_Yao
*      created: 2024-10-05 20:58:29
**/

#include<bits/stdc++.h>

using namespace std;
using LL = long long;
const int INF = 0x3f3f3f3f;


void solve()
{
    int n,k;
    cin >> n >> k;
    int l = n - k + 1;
    int r = n;
    LL ret = 0;

    int MAX,MIN;
    if(r % 2 == 1) MAX = r;
    else MAX = r - 1;
    if(l % 2 == 1) MIN = l;
    else MIN = l + 1;

    ret = (MAX - MIN) / 2 + 1;

    if(ret % 2 == 0) cout << "YES" << endl;
    else cout << "NO" << endl; 
    //cout << ret << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 0;
    cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}